#ifndef EKRAN_OCEN_H
#define EKRAN_OCEN_H

#include <QWidget>
#include <QJsonObject>
#include <QLabel>
#include <QTimer>
#include <QTime>
#include <QSettings>
#include <QHBoxLayout>
#include <QShortcut>
#include "sql/sqlrequest.h"
#include <QScreen>

QString secToMinSec(int seconds);

namespace Ui {
class ekran_ocen;
}

class ekran_ocen : public QWidget
{
    Q_OBJECT
    #define ORGANIZATION_NAME "ISAP"
    #define ORGANIZATION_DOMAIN "www.poomsae.ru"
    #define APPLICATION_NAME "ISAP"

    #define SETTINGS_KSUD "settings/ksud"

public:
    explicit ekran_ocen(QWidget *parent = nullptr);
    ~ekran_ocen();

private slots:

    void range();
    void recieveDataSys(QJsonObject json, int kolPhum);
    void recieveOcenSys(QJsonObject json);
    void showJudgesOcen(QJsonObject json);
    void vivrange();
    void minusPerfomance();
    void startTimer();
    void updateTime();
    void slotShortcutCtrlF();
    void runLine();

private:
    Ui::ekran_ocen *ui;
    QSettings *settings;
    int countJudges, kolPhum, idvist, scrollInt = 0, nomerKrug;
    int rangeViv, rangeCount = 0, tmrInt = 0, clickBtnTimer;
    int loadOcen = 0;
    QString katek;
    int pokaz;
    QLabel *lscore[4][7];
    QHBoxLayout* groupsGrades[4];
    QTimer *tmr;
    QTimer *tmrLine;
    QTimer *tmrRange;
    int secondVistup;
    SqlRequest *sqlRequest;
    QJsonObject rangeObject, totalObject;
    QShortcut  *keyCtrlF;  // объект сочетания клавиш Ctrl+S, Ctrl+F, left, right, space, Ctrl+Q
    int tempCalc, countVistup;
    int show = 0, m_shift = 0, wEkran = 0;
    int clickF = 0;
};

#endif // EKRAN_OCEN_H
